import { request } from '../../request/request'
//Page Object
Page({
  data: {
    swiper_list: [],
    catitems: [],
    floor_data: []
  },
  //options(Object)
  onLoad: function (options) {
    /* 获取轮播图 */
    this.getSwiperList();
    /* 获取导航菜单 */
    this.getNavsList();
    /* 获取楼层信息 */
    this.getFloorData();
  },
  /* 获取轮播图 */
  getSwiperList: async function () {
    let swiper_list = await request({ url: "/home/swiperdata" });
    console.log(swiper_list);
    this.setData({ swiper_list })
  },
  /* 获取导航菜单 */
  getNavsList: async function () {
    const catitems = await request({ url: "/home/catitems" })
    console.log(catitems);
    this.setData({ catitems })
  },
  /* 获取楼层信息 */
  getFloorData: async function () {
    let floor_data = await request({ url: "/home/floordata" });
    console.log(floor_data);
    this.setData({ floor_data })
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  },
  onPageScroll: function () {

  },
  //item(index,pagePath,text)
  onTabItemTap: function (item) {

  }
});
